package cn.raven.controller;

import cn.raven.entity.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {
    @Value("${server.port}")
    private int ip;
    @GetMapping("/user/{id}")
    public User getUser(@PathVariable Long id){ //url的{id} 和是参列表名字一致 可以不用加@PathVariable("id")
        return User.builder().id(id).name("ww").age("8   "+ip).build();
    }
}
